Fix: Correct location extraction logic and RAG other mode initialization#380
Fix: Correct location extraction logic and RAG other mode initialization#380ARYANPATEL-BIT wants to merge 1 commit intokubeedge:mainfrom
Conversation
|
Welcome @ARYANPATEL-BIT! It looks like this is your first PR to kubeedge/ianvs 🎉 |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: ARYANPATEL-BIT The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
There was a problem hiding this comment.
Code Review
This pull request improves location-based RAG filtering by extracting province information directly from the dataset or query text, replacing the previous unreliable directory-based detection. Review feedback suggests optimizing the location extraction logic by ensuring all_locations only contains detected provinces to avoid inefficient searches and invalid path lookups. Additionally, it is recommended to cache the dataset parsing results to prevent performance degradation during the prediction process.
examples/government_rag/singletask_learning_bench/testalgorithms/basemodel.py
Outdated
Show resolved
Hide resolved
examples/government_rag/singletask_learning_bench/testalgorithms/basemodel.py
Outdated
Show resolved
Hide resolved
examples/government_rag/singletask_learning_bench/testalgorithms/basemodel.py
Show resolved
Hide resolved
… example Signed-off-by: Aryan Patel <aryan.patel7291@gmail.com>
c02937e to
8adef5d
Compare
|
/assign @MooreZheng |
Description
This PR fixes critical data parsing and logic errors in the Government RAG benchmarking example that previously broke location-based filtering and caused the
[other]mode to crash.Changes
1. Location Extraction Overhaul (
basemodel.py)Issue
os.path.basename(os.getcwd())to determine province"ianvs")Fix
_load_locations_from_dataset(data)helper methodStrategy
.jsonldataset and extracts province fromlevel_4_dim2. Fixed Missing
all_locationsAttributeIssue
[other]mode usedself.all_locationswithout initializationAttributeErrorFix
self.all_locationsduring location extractionTesting Performed
"Shanghai")[other]mode → no crashes, correct inverted dataset behaviorType of Change
Impact
[other]mode crashFixes : #379